#!/usr/bin/env python3.0

#A Pythagorean triplet is a set of three natural numbers, a < b < c, for which,
#a^(2) + b^(2) = c^(2)
#
#For example, 3^(2) + 4^(2) = 9 + 16 = 25 = 5^(2).
#
#There exists exactly one Pythagorean triplet for which a + b + c = 1000.
#Find the product abc.

TARGET = 1000

if __name__ == '__main__':
    result = None
    for a in range(TARGET//3):
        for b in range((TARGET-a)//2):
            c = TARGET - a - b
            if a * a + b * b == c * c:
                result = a * b * c
                break
    print('Result: {0}'.format(result))
